<template>
	<view style="padding: 32rpx 32rpx 0 32rpx;">
		<u-empty v-if="noticeList==undefined||noticeList.length==0" marginTop='100' mode="data"
			:icon="require('@/static/mine/empty.png')"></u-empty>
		<view v-else>
			<view class="mes_item" v-for="(item,index) in noticeList" :key="index" @click="toRead(item)">
				<view class="info">{{item.title}}</view>
				<!-- <view class="dot"></view> -->
				<view class="between_layout" style="margin-top: 20rpx;">
					<view class="start_layout" style="color: #999;font-size: 26rpx;">
						<u-icon name="calendar" color="#999"></u-icon>
						<view class="tips_area">{{item.createTime}}</view>
					</view>
					<view class="cu-tag bg-blue radius light">{{item.typeName}}</view>
				</view>
			</view>
		</view>
		<u-loadmore v-show="noticeList.length>0" :status="status" nomoreText=' ' />
	</view>
</template>

<script>
	import {
		myToDoList
	} from "@/utils/api.js";
	export default {
		data() {
			return {
				noticeList: [],
				status: 'nomore'
			};
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				uni.showLoading({
					title: '加载中'
				});
				myToDoList().then((response) => {
					if (response.code == 200) {
						this.noticeList = response.data
						uni.hideLoading();
						this.status = 'nomore'
					} else {
						uni.hideLoading();
						this.status = 'nomore'
						uni.showToast({
							title: response.msg,
							icon: 'none'
						})
					}
				});
			},
			//跳转具体页面
			toRead(item) {
				if (item.type == 1) {
					uni.navigateTo({
						url: '/pages_two/mine/company/auditList?isAudit=1'
					})
				} else if (item.type == 7) {
					router.push("/qywtzx/wdds?searchName=" + item.name);
				} else if (item.type == 8) {
					router.push("/coordinationInfo?searchName=" + item.name);
				} else if (item.type == 9) {
					router.push("/xmgl/auditProject?state=-2&searchName=" + item.name);
				} else {
					router.push("/xmgl/approveProject?searchName=" + item.name);
				}
			}
		}
	}
</script>

<style lang="scss">
	.mes_item {
		background-color: #ffffff;
		padding: 25rpx;
		margin-bottom: 30rpx;
		border-radius: 10rpx;
		position: relative;

		.info {
			font-size: 30rpx;
		}

		.dot {
			position: absolute;
			top: 10rpx;
			right: 10rpx;
			width: 14rpx;
			height: 14rpx;
			background: #F04241;
			border-radius: 50%;
		}
	}
</style>